#include "start.h"
#include"config.h"
#include<QMouseEvent>
#include<QPainter>
start::start()
{m_start.load(start_path);
    mouse.load(start_mouse);
    x=0;
    y=0;
 free=true;
m_x=0;
m_y=0;
rect.setWidth(mouse.width());
rect.setHeight(mouse.height());
rect.moveTo(m_x,m_y);
}

void start::followpos(int x,int y)
{m_x=x;
    m_y=y;
       rect.moveTo(m_x,m_y);
}




void start::mouseMoveEvent(QMouseEvent *event)
{if(free==false)
   { int x=event->x()-rect.width()/2;
    int y=event->y()-rect.height()/2;
    //边界的限制

    followpos(x,y);}

}
